package com.douxg.learning.springboot.resttemplate;

import com.douxg.learning.springboot.resttemplate.service.impl.MainServiceImpl;
import com.douxg.learning.springboot.resttemplate.service.impl.Sub3ServiceImpl;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Primary;
import org.springframework.core.annotation.Order;

/**
 * @Description
 * @Auther douxg
 * @Date 2020/12/30 14:08
 */
@Configuration
@ConditionalOnProperty(value = "project.name", havingValue = "sub3")
public class Sub3Config extends SubConfig{
    @Bean("testController")
    public TestController createMainService2() {
        System.out.println("subtestcontroller");
        return new Sub3TestController();
    }

    @Bean("mainServiceImpl")
    public MainServiceImpl createMainService3() {
        return new Sub3ServiceImpl();
    }
}
